The present invention relates to a line segment detector that detects a line segment in an image mixedly having a dot and a line segment, in particular, to a line segment detector and a line segment detecting method in which not only the contour of a character and a line segment but also the content thereof is detected as a line-segment image and corrects erroneous determination of the line segment and preferably detects the line segment.
One example of a line segment detector is disclosed in Japanese Unexamined Patent Application Publication No. 2002-281299 (hereinafter, referred to Patent Document 1). The line segment detector detects character and diagram line-segments from input images or line segments of the contour portions of natural images. The Patent Document 1 discloses embodiments and a description will be given of one example for detecting a vertical line in an image.
A vertical line detecting/left portion averaging section sets a window near the left of a target pixel in an image and calculates the weighted average of pixel values in the set window. A vertical line detecting/right portion averaging section sets a window near the right of the target pixel in the image and calculates the weighted average of pixel values in the set window. A vertical line detecting/differentiating section calculates the absolute value of the difference between an output value of the vertical line detecting/left portion averaging section and an output value of the vertical line detecting/right portion averaging section. A vertical line/dot detecting section sets a window having the target pixel in the image and calculates the average of absolute values of differential values between upper and lower pixels in the set window. A vertical line detecting/comparing section subtracts an output value of the vertical line/dot detecting section from an output value of the vertical line detecting/differentiating section and compares the subtraction result with a threshold value. When the subtraction result is higher than the threshold value, the vertical line detecting/comparing section determines that the target pixel is a vertical line image.
With the line segment detector disclosed in the Patent Document 1, upon extracting the character or diagram from the image read by an input device of a still image, such as a color scanner, only the contour of the character or diagram is extracted. The extraction result is effective for a part of image processing, e.g., emphasis of the contour. However, upon dividing the image into a character area and an area except for the character (referred to as a photographic area) and performing image compression of the divided areas, the extraction result contains data only on the contour, the content of the character therefore remains, and preferable compression efficiency is not obtained. The improvement in compression efficiency requires not only the character contour and the entire character including the character area containing the content of the character.
As mentioned above, in the conventional detection of the line segment in the dot image, only the edge portion of the line segment is detected. Upon an object encoding, e.g., with JBIG2, MRC, or JPEG 2000-Part 6 as image compression by using the detection result, the character is not extracted as one object. Hence, the compression efficiency deteriorates because the character is divided into a mask image and a background image. Further, the image quality deteriorates. Furthermore, upon obtaining, as the extraction result, an element that is not obviously the line segment such as an isolated point, the conventional method does not have correction means thereof. Consequently, when the line segment image is emphasized in the image processing, the dot is emphasized and the image quality deteriorates.